package com.scorpionstudio.girlstoryshop.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo.State;

public class NetWork {
    public static final int TURN_ON_NETWORK = 100;
	public static boolean isOnline(Context context) {
	    ConnectivityManager mConnectManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        if (null == mConnectManager){
            return false;
        }
        if (mConnectManager.getNetworkInfo(0).getState() == State.CONNECTED
                || mConnectManager.getNetworkInfo(1).getState() == State.CONNECTED){
            return true;
        }else{
            return false;
        }
	}
}
